<%@page import="org.lzy.pt.ServerListManager"%>
<%@page import="org.lzy.pt.bean.Server"%>
<%@ page import="org.jivesoftware.openfire.security.SecurityAuditManager,
                 org.jivesoftware.openfire.session.ClientSession,
                 org.jivesoftware.openfire.user.User"
    errorPage="error.jsp"
%>
<%@ page import="org.jivesoftware.openfire.user.UserManager" %>
<%@ page import="org.jivesoftware.util.ParamUtils" %>
<%@ page import="org.xmpp.packet.JID" %>
<%@ page import="org.xmpp.packet.StreamError" %>
<%@ page import="java.net.URLEncoder" %>

<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>

<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager" />
<% webManager.init(request, response, session, application, out ); %>

<%  // Get parameters //
    boolean cancel = request.getParameter("cancel") != null;
    boolean delete = request.getParameter("delete") != null;
    String T_DomainName = ParamUtils.getParameter(request,"T_DomainName");
    int T_Port = ParamUtils.getIntParameter(request,"T_Port",0);

    // Handle a cancel
    if (cancel) {
    	response.sendRedirect("server-properties.jsp?T_DomainName="+T_DomainName+"&T_Port="+T_Port);
        return;
    }
	
    if (delete) {
    	ServerListManager.getInstance().deleteServer(T_DomainName, T_Port);
        response.sendRedirect("server-summary.jsp?deletesuccess=true");
        return;
    }
%>

<html>
    <head>
        <title><fmt:message key="user.delete.title"/></title>
        <meta name="subPageID" content="server-delete"/>
        <meta name="extraParams" content="<%= "T_DomainName="+T_DomainName+"&T_Port="+T_Port %>"/>
    </head>
    <body>

<p>
<fmt:message key="server.delete.info" />
</p>

<form action="server-delete.jsp">
<input type="hidden" name="T_DomainName" value="<%= T_DomainName %>">
<input type="hidden" name="T_Port" value="<%= T_Port %>">
<input type="submit" name="delete" value="<fmt:message key="server.delete.delete" />">
<input type="submit" name="cancel" value="<fmt:message key="global.cancel" />">
</form>

    </body>
</html>
